package thread.excese;

class demo1 {
    public static void main(String[] args) {
    Thread t_ev = new Thread( ()->{
            for(int i = 1;i < 100;i++){
                Even.printEven(i);
            }
        });
    Thread t_od = new Thread(()->{
            for(int i = 1;i < 100;i++){
                Odd.printOod(i);
            }
        });
    t_ev.start();
    t_od.start();

    }
}
class Even{
    public static void printEven(int ev){
       if(ev % 2 == 0){
           System.out.println("偶数:"+ev);
       }
    }


}
class Odd{
    public static void printOod(int od){
        if(od % 2 != 0){
            System.out.println("奇数："+od);
        }
    }

}
